#ifndef  __ENTERPRISE_TREE_CTRL__
#define	 __ENTERPRISE_TREE_CTRL__

#include <interface/global_data_interface.h>
#include <string>
struct user_data_t
{
	std::string session_id;
	std::string parent_id;
	int status;
};

struct item_data_t
{
	item_data_t(int type, const user_data_t* data)
		:chat_type(type)
	{
		if( data )
		{
			user_data = *data;
		}
	}
	int chat_type;
	user_data_t user_data;
};

class enterprise_tree_ctrl : public CTreeCtrl
{
	DECLARE_DYNAMIC(enterprise_tree_ctrl)

public:
	enterprise_tree_ctrl();
	virtual ~enterprise_tree_ctrl();

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
private:
	void on_employee_menu_notify( UINT msg_id );
	void on_department_menu_notify( UINT msg_id );
	void create_employee_menu( CString user_id, CString department_id);
	void create_department_menu( CString department_id);
	void add_employee_to_addrbook(aot::glb::iemployee_info* employee_info);

	HTREEITEM select_item_;
	HTREEITEM first_visible_item_;
public:
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
};
#endif


